unit uTile;

interface

uses Graphics, uUtils;

var
  Tile: array [-5..15] of TBitmap;
  Tileset: TBitmap;

implementation 
  
var
  I: ShortInt;

initialization
  Tileset := TBitmap.Create;
  Tileset.LoadFromFile('Sand1.bmp');
  for I := -5 to -2 do
  begin
    Tile[I] := TBitmap.Create;
    BitmapFromTileset(Tile[I], Tileset, I + 5, TileSize);
  end;
  Tileset.Free;

  Tile[-1] := TBitmap.Create;
  Tile[-1].LoadFromFile('Water.bmp');	

  Tileset := TBitmap.Create;
  Tileset.LoadFromFile('Sand2.bmp');
  for I := 0 to High(Tile) do
  begin
    Tile[I] := TBitmap.Create;
    BitmapFromTileset(Tile[I], Tileset, I, TileSize);
  end;
  Tileset.Free;

finalization
  for I := Low(Tile) to High(Tile) do Tile[I].Free;

end.
